version=$1

curl -s -k https://maven.aliyun.com/repository/public/com/taobao/arthas/arthas-packaging/${version}/arthas-packaging-${version}-bin.zip -o arthas-packaging-${version}-bin.zip
mkdir -p /opt/arthas
unzip -q -o arthas-packaging-${version}-bin.zip -d /opt/arthas
chmod -R a+rx /opt/arthas
rm -f arthas-packaging-${version}-bin.zip
echo "deploy arthas ${version} finished" > /home/kehao/arthas-result.txt